/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.difsonapps.contacttranslator.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 *
 * @author difson
 */
@Entity
@Table(name="message")
public class MessageDTO  implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
    private Long id;
	
	@Column(name="mail_subject")
    private String subject;
    
    @Column(name="mail_to")
    private String to;
    
    @Column(name="mail_cc")
    private String cc;
    
    @Column(name="mail_bcc")
    private String bcc;
    
    @Column(name="mail_from")
    private String from;
    
    @Column(name="mail_from_display")
    private String fromDisplayName;
    
    @Column(name="status")
    private boolean status;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "idcontact")
	private ContactDTO contact;
    
    @Column(name = "codeappli")
	private String codeappli;
    
    @Column(name = "type")
  	private String type;
    
    @Column(name = "lang")
  	private String lang;
    
    
    
    @Column(name = "datecreate", updatable = false, insertable = true)
	private Date datecreate;
    
	public MessageDTO(String subject, String to, String cc,
			String bcc, String from, boolean status,String codeappli) {
		super();
		this.subject = subject;
		this.to = to;
		this.cc = cc;
		this.bcc = bcc;
		this.from = from;
		this.status = status;
		this.codeappli = codeappli;
	}
	public MessageDTO() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getSubject() {
		return subject;
	}
	public void setSubject(String subject) {
		this.subject = subject;
	}
	
	public String getTo() {
		return to;
	}
	public void setTo(String to) {
		this.to = to;
	}
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	public boolean isStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
	}
	
	public String getCc() {
		return cc;
	}
	public void setCc(String cc) {
		this.cc = cc;
	}
	public String getBcc() {
		return bcc;
	}
	public void setBcc(String bcc) {
		this.bcc = bcc;
	}
	public ContactDTO getContact() {
		return contact;
	}
	public void setContact(ContactDTO contact) {
		this.contact = contact;
	}
	public Date getDatecreate() {
		return datecreate;
	}
	public void setDatecreate(Date datecreate) {
		this.datecreate = datecreate;
	}
	public String getCodeappli() {
		return codeappli;
	}

	public void setCodeappli(String codeappli) {
		this.codeappli = codeappli;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getLang() {
		return lang;
	}
	public void setLang(String lang) {
		this.lang = lang;
	}
	public String getFromDisplayName() {
		return fromDisplayName;
	}
	public void setFromDisplayName(String fromDisplayName) {
		this.fromDisplayName = fromDisplayName;
	}

	
}
